package app.biz.controller;

import app.framework.controller.base.BaseController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController extends BaseController {

	@Value("${swagger.enabled}")
	String swaggerEnabled;

	@GetMapping("/")
	public String home() {
    if (Boolean.valueOf(swaggerEnabled)) {
         return "redirect:/swagger-ui.html";
      }
      return "/index";
	}

	@GetMapping("/index")
	@ResponseBody
	public String index() {
      return "";
	}

	@GetMapping("/ajax/login")
	public String ajaxLogin() {
		return "ajax/login";
	}

	@GetMapping("/ajax/home")
	public String ajaxHome() {
		return "ajax/home";
	}

}
